/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.applicatioN.entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Slim
 */
@Entity
@Table(name = "exiger_1")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Exiger1.findAll", query = "SELECT e FROM Exiger1 e"),
    @NamedQuery(name = "Exiger1.findByNiveauExige", query = "SELECT e FROM Exiger1 e WHERE e.niveauExige = :niveauExige"),
    @NamedQuery(name = "Exiger1.findByIntitule", query = "SELECT e FROM Exiger1 e WHERE e.exiger1PK.intitule = :intitule"),
    @NamedQuery(name = "Exiger1.findByPoste", query = "SELECT e FROM Exiger1 e WHERE e.poste = :poste"),
    @NamedQuery(name = "Exiger1.findByNomPoste", query = "SELECT e FROM Exiger1 e WHERE e.exiger1PK.nomPoste = :nomPoste")})
public class Exiger1 implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected Exiger1PK exiger1PK;
    @Basic(optional = false)
    @Column(name = "NIVEAU_EXIGE")
    private int niveauExige;
    @JoinColumn(name = "NOM_POSTE", referencedColumnName = "NOM_POSTE", insertable = false, updatable = false)
    @ManyToOne(optional = false,fetch=FetchType.EAGER)
    private Poste poste;
    @JoinColumn(name = "INTITULE", referencedColumnName = "INTITULE", insertable = false, updatable = false)
    @ManyToOne(optional = false,fetch=FetchType.EAGER)
    private Langue langue;

    public Exiger1() {
    }

    public Exiger1(Exiger1PK exiger1PK) {
        this.exiger1PK = exiger1PK;
    }

    public Exiger1(Exiger1PK exiger1PK, int niveauExige) {
        this.exiger1PK = exiger1PK;
        this.niveauExige = niveauExige;
    }

    public Exiger1(String intitule, String nomPoste) {
        this.exiger1PK = new Exiger1PK(intitule, nomPoste);
    }

    public Exiger1PK getExiger1PK() {
        return exiger1PK;
    }

    public void setExiger1PK(Exiger1PK exiger1PK) {
        this.exiger1PK = exiger1PK;
    }

    public int getNiveauExige() {
        return niveauExige;
    }

    public void setNiveauExige(int niveauExige) {
        this.niveauExige = niveauExige;
    }

    public Poste getPoste() {
        return poste;
    }

    public void setPoste(Poste poste) {
        this.poste = poste;
    }

    public Langue getLangue() {
        return langue;
    }

    public void setLangue(Langue langue) {
        this.langue = langue;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (exiger1PK != null ? exiger1PK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Exiger1)) {
            return false;
        }
        Exiger1 other = (Exiger1) object;
        if ((this.exiger1PK == null && other.exiger1PK != null) || (this.exiger1PK != null && !this.exiger1PK.equals(other.exiger1PK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.applicatioN.entities.Exiger1[ exiger1PK=" + exiger1PK + " ]";
    }
    
}
